<?php

class Application_Form_UserUpdate extends Zend_Form
{

    public function init()
    {
        $this->setName('uinfoform');
        $this->setMethod('POST');
        
        $uinfoName = new Zend_Form_Element_Text('username');
        $uinfoName->setLabel('用户名')
                ->setRequired(true)
                ->setAttrib('class','border')
                ->addValidator('NotEmpty');
        
        $uinfoEmail = new Zend_Form_Element_Text('email');
        $uinfoEmail->setLabel('Email')
                ->setRequired(true)
                ->setAttrib('class','border')
                ->addFilter('StringTrim')
                ->addFilter('StripTags')
                ->addValidator('NotEmpty')
                ->addValidator('EmailAddress');
        
        $uinfoPass = new Zend_Form_Element_Text('password');
        $uinfoPass->setLabel('密码')
                ->setAttrib('class','border')
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('StringLength',false,array(6,20));
        
        $uinfoGendar = new Zend_Form_Element_Select('gender');
        $uinfoGendar->setLabel('性别')
                ->setRequired(true)
                ->setAttrib('class','border')
                ->addMultiOption('0','男')
                ->addMultiOption('1','女');
        
        $uinfoQq = new Zend_Form_Element_Text('qq');
        $uinfoQq->setLabel('QQ')
                ->setRequired(true)
                ->setAttrib('class','border')
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty','Digits');
        
        $uinfoMsn = new Zend_Form_Element_Text('msn');
        $uinfoMsn->setLabel('MSN')
                ->setRequired(true)
                ->setAttrib('class','border')
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty','EmailAddress');
        
        $uinfoBtn = new Zend_Form_Element_Submit('submit');
        $uinfoBtn->setLabel('确认更改')
                ->setAttrib('class','submit');
        
        $this->addElements(array($uinfoName,$uinfoPass,$uinfoEmail,$uinfoGendar,$uinfoQq,$uinfoMsn,$uinfoBtn));
    }


}

